/**
 * utilfun.c
 *
 * utilities function implementation.
 *
 * Copyright (c) sti-seedclass 2011, tankery.chen@gmail.com
 */
#include "LPC11xx.h"
#include "utilfun.h"
#include "timer32.h"

#define SLEEP_TIMER 	0
#define NORMAL_TIMER	1

void utilInit(void)
{
	Timer32Init(NORMAL_TIMER);
	Timer32Init(SLEEP_TIMER);
}

void utilSleepMs(uint32_t mstime)
{
	Timer32DelayMs(SLEEP_TIMER, mstime);
}

void utilDelayMs(uint32_t mstime)
{
	Timer32DelayMs(NORMAL_TIMER, mstime);
}

void utilSleepUs(uint32_t ustime)
{
	Timer32DelayUs(SLEEP_TIMER, ustime);
}

void utilDelayUs(uint32_t ustime)
{
	Timer32DelayUs(NORMAL_TIMER, ustime);
}
